#ifndef DARRAY_HPP
#define DARRAY_HPP

#include <iostream>

/*=========================================================
  DArray.hpp
  Dynamic-Array class defintion.
  We generate dynamic array by DArray class.
  We hope this may get better efficiency than the vector lib

  Author: Ju Liu, Sept 27th 2011
  =======================================================*/

class DArray
{
  public:
    DArray(const int size);
    ~DArray();
    int size() const;
    const double& operator[](int index) const;
    double& operator[](int index);
    /*Define operator +=: x+=y return x=x+y */  
    DArray& operator+=(const DArray& rhs); 
    /* Define operator *=: x*=y return x= x*y */
    DArray& operator*=(const double& rhs);
    /* simple show function, show the contents of the array*/
    void print();
  private:
    double* arrayPtr; // The pointer to the dynArray class
    int msize; // The array size.
};


#endif
